package com.bdqn.struts.action;

import com.bdqn.struts.entity.Login;
import com.bdqn.struts.service.LoginService;
import com.bdqn.struts.service.impl.LoginServiceImpl;
import com.opensymphony.xwork2.ActionSupport;

import java.util.ArrayList;
import java.util.List;

public class LoginAction3 extends ActionSupport {
    private List<Login> loginList=new ArrayList<Login>();
    LoginService loginService=new LoginServiceImpl();

    //查询所有用户
    @Override
    public String execute() throws Exception {
        loginList=loginService.getAllLogin();
        if (loginList.size()>0){
            return "success";
        }
        return "error";
    }

    public List<Login> getLoginList() {
        return loginList;
    }

    public void setLoginList(List<Login> loginList) {
        this.loginList = loginList;
    }

    public LoginService getLoginService() {
        return loginService;
    }

    public void setLoginService(LoginService loginService) {
        this.loginService = loginService;
    }
}
